package com.qf;

import com.qf.dao.PassengerDao;
import com.qf.pojo.Passenger;
import com.qf.utils.MyBatisUtils;

import org.junit.Test;

import java.util.HashMap;
import java.util.List;
import java.util.Map;


public class test {

    @Test
    public void testQueryAll(){
        PassengerDao mapper = MyBatisUtils.getMapper(PassengerDao.class);
        Map<String,Object> map = new HashMap<String,Object>();
//        map.put("name","王");
        map.put("age",15);
        List<Passenger> passengers = mapper.queryAll(map);
        for (Passenger passenger : passengers) {
            System.out.println(passenger);
        }
    }

    @Test
    public void testSelectByNameAndId(){
        PassengerDao mapper = MyBatisUtils.getMapper(PassengerDao.class);
        Passenger passenger = mapper.selectByNameAndId(1, null);
        System.out.println(passenger);
    }
}
